<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="referrer" content="origin">
    <meta name="viewport"
        content="width=device-width, viewport-fit=cover, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
    <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
    <title>商家小票</title>
    <script type="text/javascript" charset="UTF-8" src="https://wx.gtimg.com/pay_h5/goldplan/js/jgoldplan-1.0.0.js"></script>
    <script type="text/javascript" src="https://cdn.bootcss.com/vConsole/3.3.0/vconsole.min.js"></script>
    <script type="text/javascript" src="https://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>

    <style>
        body {
            font-family: PingFang SC, "Helvetica Neue", Arial, sans-serif;
        }

        .order_box {
            text-align: center;
        }
        .btns .btn {
            width: 147px;
            height: 35px;
            line-height: 35px;
            font-size: 14px;
            border-radius: 39px;
            border: 1px solid #CD2314;
            box-sizing: border-box;
            color: #CD2314;
            margin: auto;
            margin-top:15px;
        }
		.price {
            color: #E61515
        }
        .btns .btn.detail {
            background: linear-gradient(270deg, #D51010 0%, #EF4D2D 100%);
            color: #fff;
        }
        .amount{
        	margin-top: 35px;
        }
		.content{
			margin-top: 30px;
			font-size: 25px;
			font-weight: 900;
		}

    </style>
</head>

<body>
<!-- 中金小票 -->
<div id="cpcn">
	<div class="order_box">
        <div class="bussiness_avt">
            <img  id="b_avt" src="https://www.cpcn.com.cn/img/icon_03_03.png" alt="">
        </div>
        <div class='content'>
			商家小票页面
		</div>
        <div class="btns amount" >
        	<div>支付金额：123.00 <span id="price" class="price">￥</span></div>
            <div id="backHome" class="btn home">首页(内跳)</div>
            <div id="jumpBtn" class="btn detail">详情(外跳)</div>
        </div>
    </div>
</div>
   

    <script>
        //初始化console
        var vConsole = new VConsole();

        document.getElementById("backHome").onclick = function () {
            window.location.href='https://www.baidu.com';
        }
        
        document.getElementById("jumpBtn").onclick = function () {
            let mchData = { action: 'jumpOut', jumpOutUrl: "https://www.baidu.com" };
            let postData = JSON.stringify(mchData);
            parent.postMessage(postData, 'https://payapp.weixin.qq.com'); 
        }
        
        //初始化小票
        var initData = {
            action: 'onIframeReady',
            displayStyle: 'SHOW_CUSTOM_PAGE'
        }
        var initPostData = JSON.stringify(initData)
        parent.postMessage(initPostData, 'https://payapp.weixin.qq.com')
    </script>
</body>

</html>